using System;
using System.Data;
using System.Collections.Generic;
using System.Data.SqlClient;

namespace DataAccess
{
    public class tbPowers : Popular
    {

        public int PowersID { get; set; }
        public int MenuID { get; set; }
        public int GroupID { get; set; }
        public int NumberPermison { get; set; }
        Common<tbPowers> cm = new Common<tbPowers>();
        public bool Insert(Popular b)
        {
            return cm.Insert(b as tbPowers, "sp_tbPowers_Insert");
        }
        public bool Update(Popular b)
        {
            return cm.UpDate(b as tbPowers, "sp_tbPowers_Update");
        }
        public bool Delete(object b)
        {
            return cm.Delete(b, "sp_tbPowers_Delete");
        }
        public IDataReader Select_ID(object b)
        {
            return cm.Select_ID(b, "sp_tbPowers_SelectByID");
        }
        public IDataReader Select_Name(object b)
        {
            return cm.Select_Name(b, "sp_tbPowers_SelectByName");
        }
        public IDataReader SelectAll()
        {
            return cm.Select_All("sp_tbPowers_SelectAll");
        }
        public List<tbPowers> SelectAllToList()
        {
            return cm.SelectAll<tbPowers>("sp_tbPowers_SelectAll");
        }
        public List<tbPowers> GetByGroupID(object b)
        {
            return Core.CBO.FillCollection<tbPowers>(Core.DataProvider.Instance.ExecuteReader("sp_tbPowers_GetByGroup", b));
        }
        public List<tbPowers> GetByMenu(object b)
        {
            return Core.CBO.FillCollection<tbPowers>(Core.DataProvider.Instance.ExecuteReader("sp_tbPowers_GetByMenu", b));
        }
    }
}